home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / basic / qlib.exe / GRAPHICS.DOC < prev    next >
Encoding:
Text File  |  1992-05-17  |  62.9 KB  |  1,565 lines

  1.  
  2. ************************ QLIB GRAPHICS ***********************************
  3.  
  4.   QLIB's graphics subroutines were written initially to provide Hercules
  5.   graphics functions without using QB's QBHERC.COM or MSHERC.COM memory-
  6.   resident drivers, and to provide added capabilities.  Most of these
  7.   subroutines now work in additional graphics modes.  QLIB automatically
  8.   configures itself for the graphics mode in use.
  9.  
  10.   Locations on Graphics screens are defined by coordinate pairs such as (x,y).
  11.   X-coordinates are the horizontal dimensions of the screen, and Y-coordinates
  12.   are the vertical coordinates.  X = 0 is the at the left edge of the screen,
  13.   and X = 719 is the right edge of a Hercules screen, while Y = 0 is the top
  14.   edge of the screen and Y = 347 is the bottom (Hercules).  Thus, the
  15.   coordinate (719,0) is the upper right corner of a Hercules screen.  Maximum
  16.   coordinate values for supported modes are shown on the next page.
  17.  
  18.   You may also use your own coordinate system with QLIB graphics, similar
  19.   to using WINDOW with BASIC's graphics functions.  See QWindow at the
  20.   end of this file.
  21.  
  22.  
  23.  
  24.   QLIB graphics modes are:
  25.  
  26.   Mode           Maximum x   Maximum y    Colors    Equipment
  27.  
  28.   HGraph           719          347       2         Hercules
  29.   HGraph           719          347       16        Hercules InColor
  30.   SCREEN 1         319          199       4         CGA, EGA, MCGA, VGA
  31.   SCREEN 2         639          199       2         CGA, EGA, MCGA, VGA
  32.   SCREEN 3 (1)     719          347       2         Hercules
  33.   SCREEN 4         639          399       2         ATT 6300  (5)
  34.   SCREEN 7         319          199       16        EGA, VGA
  35.   SCREEN 8         639          199       16        EGA, VGA
  36.   SCREEN 9         639          349       16        EGA, VGA  (2)
  37.   SCREEN 10        639          349       4         EGA, VGA  (3)
  38.   SCREEN 11        639          479       2         MCGA, VGA
  39.   SCREEN 12        639          479       16        VGA
  40.   SCREEN 13        319          199       256       MCGA, VGA
  41.   VESA6A           799          599       16        (4)
  42.   XMode16      up to 799     up to 599    16        Super EGA/VGA
  43.   Super13          319          399       256       VGA
  44.   Super13a         359          479       256       VGA
  45.   SVGA16       up to 1024    up to 768    16        Super VGA
  46.   SVGA256      up to 1024    up to 768    256       Super VGA
  47.  
  48.   (1) Requires MSHERC.COM or QBHERC.COM
  49.   (2) EGA with 128k or more memory
  50.   (3) monochrome monitor only
  51.   (4) VESA6A is supported by many Super VGA cards with multi-frequency
  52.       monitors.  See ScreenMode.
  53.   (5) untested mode; should work with any subroutine which supports
  54.       SCREEN 2.  Your feedback, please!
  55.  
  56.   Registered QLIB users may use QLIB's EGAVGA.obj and NOSVGA.obj
  57.   stub files to reduce the size of their .EXE files.  QLIB's stub files
  58.   are similar to the NOEM.obj and NOCOM.obj files supplied by Microsoft
  59.   with QuickBASIC.  EGAVGA eliminates code and data required for monochrome,
  60.   CGA and InColor graphics modes, while NOSVGA eliminates code for Super VGA
  61.   modes.  You must link with the /NOE option when using these stub files.
  62.  
  63.   Example:  I want MYPROG.EXE to support only EGA or VGA 16-color modes
  64.  
  65.   compile: BC MYPROG /O;
  66.   link:    LINK /EX /NOE MYPROG+EGAVGA+NOSVGA,,,QLIB;
  67.  
  68.   linking with EGAVGA.obj reduces .EXE file size by up to 2,630 bytes;
  69.   linking with NOSVGA.obj reduces .EXE size by up to 3,152 bytes.
  70.  
  71. The style% parameter used in many QLIB Graphics subroutines follows these
  72. general rules:
  73.  
  74.     style% =  0 XORs the text/pixel/line/whatever with the pre-existing
  75.                 screen: if a pixel (x,y) is XORed to the screen, the pixel
  76.                 will be turned on if previously off, or will be turned off
  77.                 if previously on;
  78.  
  79.     style% =  1 is normal; lines are drawn, pixels are turned on, text is
  80.                 foreground-on-background, and the previous screen content
  81.                 is ignored or obliterated;
  82.  
  83.     style% =  2 similar to style% 1, but foreground color only is updated
  84.  
  85.     style% =  3 ORs the line or block with the existing screen; this means
  86.                 that the new stuff is added to the old.
  87.  
  88.     style% =  4 ANDs a block (or fillbox) with the existing screen; within
  89.                 the block's limits, only those pixels where both the
  90.                 previous screen and the pattern in the block have ON pixels
  91.                 will there be a resulting ON pixel;
  92.  
  93.     style% = -3 similar to style% 3, but reverses the foreground and
  94.                 background before combining it with the screen
  95.  
  96.     style% = -2 similar to style% 2, but reverses the foreground and
  97.                 background before combining it with the screen
  98.  
  99.     style% = -1 like style% 1, but uses background color.  In monochrome
  100.                 modes, pixels are erased, text is black with a bright
  101.                 background.
  102.  
  103.  
  104.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  105.  
  106.     Subroutine: BitBlockSave(seg%, x0%, y0%, x1%, y1%)
  107.     Subroutine: BitBlockRestore(seg%, x%, y%, style%)
  108.     object files: bitblock.obj ($graph.obj, bb02.obj, bb04.obj, bb06.obj,
  109.                                 bb08.obj, bb10.obj, bb12.obj, bb14.obj)
  110.  
  111.     Function: bytes% = BitBlockBytes(x0%, y0%, x1%, y1%)
  112.     object files: bbbytes.obj ($graph.obj)
  113.  
  114.     Modes supported: All
  115.  
  116.     BitBlockSave copies a section of the graphics screen to system memory
  117.     in order to copy the block back to the screen later with BitBlockRestore.
  118.  
  119.     BitBlockBytes returns the number of bytes of memory required store
  120.     the entire pixel block.  Bytes% = 0 if the block is too big.  After
  121.     calculating the bytes required, you may use AllocMem(bytes) to
  122.     allocate the memory space required.  See AllocMem in DATA.DOC.
  123.     Note that bit block memory requirements can be large; the huge model
  124.     library QLIBH.LIB is required for large bitblocks in 16-color and
  125.     256-color modes.
  126.  
  127.     style% values supported by BitBlockRestore are:
  128.  
  129.     SCREEN 13, super13, super13a, SVGA256:
  130.      1 = replace existing screen area with bit block
  131.      2 = replace existing screen with non-zero pixels in bit block
  132.  
  133.     HGraph (InColor):
  134.      4 = AND the bit block with the existing screen
  135.      3 = OR the bit block with the existing screen
  136.      1,2 = replace existing screen area with bit block
  137.      0 = XOR the bit block with the existing image
  138.     -1,-2 = replace existing screen area with inverse bit block
  139.  
  140.      16-color EGA/VGA-type modes including SVGA16, and SCREEN 10:
  141.       same as InColor, plus:
  142.      -3 = OR the inverse bit block with the existing screen
  143.      -4 = AND the inverse bit block with the existing screen
  144.  
  145.      SCREEN 1, 2, 3, 11, and HGraph (mono):
  146.       2 = combine non-zero pixels in the bit block with the
  147.           pre-existing image
  148.       1 = replace the existing screen image with un-altered
  149.           bit block
  150.       0 = XOR the bit block with the existing image
  151.      -1 = replace existing screen image with inverse bit block
  152.      -2 = combine non-zero pixel in the inverse bit block with
  153.           the previous screen image
  154.  
  155.     See example on next page.
  156.  
  157.     BIT BLOCK EXAMPLE:
  158.  
  159.  
  160.         REM  This example calculates the array size required,
  161.         REM  dimensions the array, saves a portion of the screen and
  162.         REM  restores it later.
  163.  
  164.         REM $INCLUDE: 'qlib.bi'
  165.         REM  start in the desired graphics mode
  166.               .
  167.               .
  168.               .
  169.         x0 = 100: y0 = 0: x1 = 400: y1 = 347
  170.         bytes% = BitBlockBytes(x0%, y0%, x1%, y1%)
  171.         REM  Note that BitBlockBytes returns a LONG integer when
  172.         REM  assembled with the .MODEL HUGE directive
  173.         bbseg% = AllocMem(bytes%)
  174.         CALL BitBlockSave(bbseg%, x0%, y0%, x1%, y1%)
  175.               .
  176.               .
  177.               .
  178.         REM  now we'll copy the block back to the screen
  179.         CALL BitBlockRestore(bbseg%, x2%, y2%, style%)
  180.         REM  x2% and y2% may be any coordinates on the screen
  181.         REM  also release the memory block
  182.         CALL FreeMem(bbseg%)
  183.  
  184.  
  185.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  186.  
  187.     Subroutine: BitPlaneSave(seg%, x0%, y0%, x1%, y1%, plane%)
  188.     Subroutine: BitPlaneRestore(seg%, x0%, y0%, style%, plane%)
  189.     object files: same as BitBlockRestore and BitBlockSave
  190.  
  191.     Function: bytes% = BitPlaneBytes(x0%, y0%, x1%, y1%)
  192.     object files: bbbytes.obj ($graph.obj)
  193.  
  194.     Modes supported: HGraph (InColor)
  195.                      SCREEN 7,8,12
  196.                      SCREEN 9  (requires 128k+ EGA memory)
  197.                      VESA6A, XMode16
  198.                      SCREEN 10 (planes 0 and 2)
  199.  
  200.     BitPlaneSave subroutines copy a section of the graphics screen to a
  201.     memory buffer in order to copy that block back to the screen with
  202.     BitPlaneRestore.  This is similar to the BitBlockSave/BitBlockRestore
  203.     subroutines, except that BitPlane subroutines copy to or from only one
  204.     of the four "planes" of memory in 16-color modes.  This is handy when
  205.     the area you want to copy is too big to fit in one array, or when you
  206.     want to move or modify only one plane at a time.  The exact color
  207.     represented by each plane is determined by PALETTE or COLOR statements.
  208.  
  209.     BitPlaneBytes calculates the number of bytes of memory required to save
  210.     the desired portion of the plane.  All style% values work with
  211.     BitPlaneRestore.  You may use AllocMem(bytes%) to allocate memory
  212.     space for the bit plane.
  213.  
  214.     Example:
  215.          REM $INCLUDE: 'qlib.bi'
  216.          REM  calculate the array size required, allocate the memory,
  217.          REM  save a portion of one plane of the screen and restores it later.
  218.          REM  note that valid plane numbers are 0 - 3
  219.  
  220.          REM  First I need to establish graphics mode
  221.          CALL Xmode16(xmode%, maxX%, maxY%)
  222.               .
  223.               .
  224.          x0 = 100: y0 = 0: x1 = 400: y1 = 347
  225.          bytes% = BitPlaneBytes(x0%, y0%, x1%, y1%)
  226.          seg% = AllocMem(bytes%): plane% = 0
  227.          CALL BitPlaneSave(seg%, x0%, y0%, x1%, y1%, plane%)
  228.               .
  229.               .
  230.          REM  now we'll copy the plane back to the screen
  231.          CALL BitPlaneRestore(seg%, x2%, y2%, style%, plane%)
  232.  
  233.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  234.  
  235.     Subroutine: ClearView
  236.     object files: clrview.obj ($graph.obj, $horiz.obj)
  237.  
  238.     Modes supported: All
  239.  
  240.        ClearView erases everything within the active viewport.  In
  241.     color modes, the background color set by GraphColor is used.  Use
  242.     SetView to establish the active viewport.
  243.  
  244.     Example:
  245.       CALL ClearView
  246.  
  247.  
  248.  
  249.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  250.  
  251.     Subroutine: DrawBox(x0%, y0%, x1%. y1%, style%)
  252.     object file: drawbox.obj ($graph.obj, $horiz.obj, $vert.obj)
  253.  
  254.     Modes supported: All
  255.  
  256.          DrawBox draws a box with corners at (x0%, y0%), (x0%, y1%),
  257.     (x1%, y0%), (x1%, y1%).  Legal style% parameters are -1, 0, and 1.
  258.     If any part of the box lies outside the active graphics viewport,
  259.     that part of the box will not be drawn.  See also LinePattern.
  260.  
  261.     Example:
  262.          CALL HGraph
  263.          x0% = 10: y0% = 10: x1% = 79: y1% = 38: style% = 0
  264.          CALL DrawBox(x0%, y0%, x1%, y1%, style%)
  265.  
  266.  
  267.  
  268.  
  269.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  270.  
  271.     Subroutine: DrawCircle(xc%, yc%, Xradius%, style%)
  272.     Subroutine: CircleAspect(numerator%, denominator%)
  273.     object files: drawcirc.obj ($graph.obj, $putdot.obj)
  274.  
  275.     Modes supported: All
  276.  
  277.        DrawCircle draws a circle on a graphics screen centered at xc%, yc%,
  278.     with x-radius Xradius%.  The circle's aspect ratio may be changed with
  279.     CircleAspect.  Legal style% parameters are -1, 0 and 1 with monochrome
  280.     modes.  In color modes, style% parameters 2, -2, 3 and -3 are also
  281.     supported. Only the part of the circle which lies within the viewport
  282.     defined by SetView will be drawn.
  283.  
  284.     CircleAspect changes the aspect ratio of the circle; using CircleAspect,
  285.     you can make the circle look like a flattened ellipse or a tall ellipse.
  286.     CircleAspect changes the Y-dimension of the circle; the X-dimension is
  287.     controlled with Xradius%.  QLIB's default is an aspect ratio of 1:1 in
  288.     most graphics modes.  SCREEN 12 and XMode16 circles may not have a 1:1
  289.     aspect ratio.  CAUTION: extreme aspect ratios are not supported by
  290.     DrawCircle.  With numerator% = 1, a maximum usable denominator% is 5,
  291.     or else a "divide by zero" error will occur.  With denominator% = 1,
  292.     a high numerator will cause unpredictable results.
  293.  
  294.     Example:
  295.          CALL DrawCircle(xc%, yc%, Xradius%, style%)
  296.  
  297.  
  298.  
  299.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  300.  
  301.     Subroutine: DrawLine(x0%, y0%, x1%, y1%, style%)
  302.     object files: drawline.obj ($graph.obj, $horiz.obj, $vert.obj
  303.                                 $loslope.obj, $hislope.obj)
  304.  
  305.     Modes supported: All
  306.  
  307.        DrawLine draws a line from x0%, y0% to x1%, y1%.  Legal style
  308.     parameters are -4 through 4.  See also LinePattern.
  309.  
  310.     Example:
  311.          x0% = 0: y0% = 0: x1% = 719: y1% = 348: style% = -1
  312.          CALL DrawLine(x0%, y0%, x1%, y1%, style%)
  313.          REM this erases a diagonal line across the screen
  314.  
  315.  
  316.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  317.  
  318.    Subroutine: FillArea(x%, y%, reserved%)
  319.    object files: fillarea.obj ($graph.obj, $horiz.obj, fpattern.obj)
  320.  
  321.    Modes supported: All
  322.  
  323.          FillArea fills irregularly-shaped areas enclosed by solid lines.
  324.     FillArea works best with SIMPLE areas; holes in the area or areas with
  325.     "inside" corners dividing horizontal lines may not be filled properly.
  326.     Further development is planned, but FillArea in its present form is
  327.     useful in many circumstances.  FillArea works by starting at the seed
  328.     pixel (x%, y%) and looking left and right for non-black region boundaries,
  329.     then filling horizontal lines between the boundaries.  FillArea works
  330.     upward until the top of the area has been reached, then returns to the
  331.     seed pixel and works downward.  Reserved% is reserved for QLIB's style%
  332.     parameter.  FillArea presently assumes style% = 1.
  333.  
  334.     Example:
  335.          CALL HGraph
  336.               .
  337.               .
  338.               .
  339.          CALL GraphColor(attr%)             ' for color modes
  340.          CALL FillPattern(pattern$)         ' optional fill pattern
  341.          CALL FillArea(x%, y%, reserved%)
  342.  
  343.  
  344.  
  345.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  346.  
  347.     Subroutine: FillBox(x0%, y0%, x1%. y1%, style%)
  348.     object files: fillbox.obj ($graph.obj, $horiz.obj)
  349.  
  350.     Modes supported: All
  351.  
  352.        Similar to DrawBox, FillBox uses the same coordinates and style
  353.     variable, but fills the box instead of drawing the sides.  If
  354.     style% = 1 or 2, an optional pattern may be used to fill the box
  355.     (except SCREEN 1).  See FillPattern.
  356.  
  357.     Example:
  358.       CALL HGraph
  359.          x0% = 10: y0% = 10: x1% = 79: y1% = 38: style% = 0
  360.          CALL FillBox(x0%, y0%, x1%, y1%, style%)
  361.  
  362.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  363.  
  364.     Subroutine: FillPattern(pattern$)
  365.     object files: fpattern.obj ($horiz.obj, $graph.obj)
  366.  
  367.     Modes supported: HGraph (mono annd InColor)
  368.                      VESA6A, XMode16, SVGA16
  369.                      SCREEN 2,3,7,8,9,10,11,12
  370.  
  371.         FillPattern defines an optional pattern used by FillBox if
  372.     style% >= 1,  or by FillArea (which assumes style% = 1). The bit
  373.     patterns in the first 8 characters of pattern$ are used to modify the
  374.     fill in the box or area.  FillPattern must be called before each call
  375.     to FillBox or FillArea.  See Examples.  FillBox will replace box borders.
  376.     If you want the box to have a solid outline, call DrawBox with style% = 1
  377.     after using FillBox with a pattern.  Using style% = 1, the pattern will
  378.     completely replace whatever was in the box.  16-color modes use
  379.     style% = 2.  BIT2INT in DATA.DOC is useful for establishing patterns.
  380.  
  381.     Sample patterns, and what they produce:
  382.  
  383.     pattern$ = CHR$(255) + STRING$(5,32)    ' produces a pattern of squares
  384.     pattern$ = STRING$(8,32)                ' produces vertical lines
  385.     pattern$ = CHR$(255) + STRING$(5,0)     ' produces horizontal lines
  386.  
  387.     pattern$ = STRING$(8,0): k% = 1
  388.     FOR i% = 1 TO 8
  389.          MID$(pattern$, i%) = CHR$(k%)
  390.          CALL ShiftINT(k%, 1)
  391.     NEXT i%                                 ' produces diagonal lines, from 
  392.                                             ' upper right to lower left
  393.     pattern$ = STRING$(8,0):k% = 128
  394.     FOR i% = 1 TO 8
  395.          MID$(pattern$, i%) = CHR$(k%)
  396.          CALL ShiftINT(k%, -1)
  397.     NEXT i%                                 ' produces diagonal lines, from
  398.                                             ' upper left to lower right
  399.  
  400.     Example:
  401.       x0% = 10: y0% = 10: x1% = 79: y1% = 38: style% = 1
  402.       pattern$ = CHR$(255) + STRING$(5,32)        ' pattern for squares
  403.       CALL FillPattern(pattern$)
  404.       CALL FillBox(x0%, y0%, x1%, y1%, style%)    ' fill box with pattern
  405.       CALL DrawBox(x0%, y0%, x1%, y1%, style%)    ' draw solid box outline
  406.       CALL FillArea(x%, y%, reserved%)            ' no pattern used
  407.                                                   ' because FillPattern
  408.                                                   ' was not called before
  409.                                                   ' FillArea
  410.  
  411.  
  412.  
  413.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  414.  
  415.     Subroutine: GCopy(frompage%, topage%, oops%)
  416.     object files: gcopy.obj ($graph.obj)
  417.  
  418.     Modes supported: HGraph (mono and InColor)
  419.                      Super13
  420.                      SCREEN 3,7,8,9,10
  421.  
  422.         Similar to BASIC's PCOPY command, GCopy copies one page of
  423.     graphics memory to another, but returns an error flag instead of
  424.     requiring ON ERROR to trap errors.  GCopy also works with the Super13
  425.     VGA mode.  oops% = 0 if no error, or -1 if GCopy is not supported or
  426.     if either frompage% or topage% is too large.
  427.  
  428.     Example:
  429.         frompage% = 0: topage% = 1
  430.         CALL GCopy(frompage%, topage%, oops%)
  431.  
  432.  
  433.  
  434.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  435.  
  436.     Subroutine: GetDot(x%, y%, value%)
  437.        (formerly GetPixel)
  438.     object file: getdot.obj ($graph.obj, $getdot.obj)
  439.  
  440.     Modes supported: All
  441.  
  442.          Determines the color of the pixel located at (x%, y%).
  443.     Returns value% = -1 if (x%,y%) falls outside the active graphics
  444.     viewport.
  445.  
  446.     Example:
  447.          x% = 0: y% = 0
  448.          CALL GetPixel(x%, y%, value%)
  449.          REM  This will determine the color of the pixel at the upper left
  450.          REM  corner of the screen.
  451.  
  452.  
  453.  
  454.  
  455.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  456.  
  457.     Subroutine: GraphColor(attr%)
  458.     object files: gcolor.obj ($graph.obj)
  459.  
  460.     Modes supported: HGraph (InColor)
  461.                      VESA6A, XMode16, Super13, Super13a, SVGA16, SVGA256
  462.                      SCREEN 1,7,8,9,10,12,13
  463.  
  464.         Sets the color attribute to be used when QLIB subroutines are
  465.     used in color modes.  Color attributes for 16-color modes may be
  466.     calculated with ColorAttr (See VIDEO.DOC).
  467.  
  468.  
  469.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  470.  
  471.     Subroutine: GCursor(x%, y%)
  472.     Subroutine: GUCursor(x%, y%)
  473.     object file: gcursor.obj ($graph.obj, $putdot.obj)
  474.  
  475.     Modes supported: All
  476.  
  477.        GCursor subroutines put a text cursor on graphics screens
  478.     at the character box with upper left coordinates at x%, y%.
  479.     GCursor and GUCursor subroutines are similar to QLIB's text-mode
  480.     CursorON and UCursorON subroutines, except that GCursor waits until
  481.     a key has been pressed before returning to QuickBASIC.  The key
  482.     pressed may be determined with QLIB's input subroutines, or with
  483.     QB's INKEY$ function.  In HGraph, SCREEN 9, 10, or 12, GCursor
  484.     subroutines work with either normal text or QLIB's small text.  To use
  485.     GCursor with text printed by BASIC, see example 2.
  486.  
  487.     Example 1:
  488.          CALL HGraph
  489.          a$ = "I want a cursor at the 'I' at the start of this line"
  490.          x% = 5: y% = 3: style% = 1
  491.          CALL GPrint(a$, x%, y%, style%)
  492.          CALL GCursor(x%, y%)
  493.  
  494.     Example 2:
  495.          SCREEN 3                           ' uses QBHERC.COM or MSHERC.COM
  496.          CALL StdText                       ' make sure the BIOS data area
  497.                                             ' has been updated
  498.          row% = 10: column% = 3
  499.          LOCATE row%, column%: PRINT a$     ' use QB to print text
  500.          x% = (column% - 1) * 9             ' this example is for a
  501.          y% = (row% - 1) * 14               ' QBHERC 9x14 character box
  502.          CALL GCursor(x%, y%)
  503.  
  504.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  505.  
  506.     Subroutine: GMouse
  507.     object files: gmouse.obj (mousedat.obj, $graph.obj)
  508.  
  509.     GMouse initializes the alternate graphics mouse cursor driver.
  510.     After calling GMouse, QLIB's alternate mouse cursor may be used in
  511.     any graphics mode supported by QLIB.  This is nessesary because most
  512.     mouse drivers do not recognize modes other than those supported by
  513.     IBM-brand equipment (such as Hercules, InColor, ATT, super13, SVGA,
  514.     xmode16).
  515.  
  516.     The GMouse cursor has some limitations: it wraps around to the left
  517.     side of the screen if it gets within 13 pixels of the right edge, it
  518.     does not (yet) respond to QLIB's MouseLimit subroutine, and it must
  519.     first be hidden with HideGMouse before using MousePos.  GMouse works
  520.     with these QLIB mouse subroutines:
  521.  
  522.      MouseStatus   KeyOrButton   HideGMouse   ShowGMouse   MousePos
  523.  
  524.     Any time you change graphics modes, you must re-initialize GMouse.
  525.     Turn GMouse off with HideGMouse before you switch back to text mode.
  526.  
  527.     Example:
  528.        REM $INCLUDE: 'qlib.bi'    ; has declaration for MouseReady
  529.  
  530.       ' enter desired graphics mode before calling GMouse
  531.        svgaOK = SVGA256(3)
  532.        IF MouseReady THEN CALL GMouse: CALL ShowGMouse
  533.         .
  534.         .
  535.         .
  536.       ' move the mouse cursor to new location
  537.        CALL HideGMouse
  538.        CALL MousePos(x%, y%)
  539.        CALL ShowGMouse
  540.  
  541.  
  542.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  543.  
  544.     Subroutines: HGraph, HGraph0
  545.     object files: hgraph.obj (q$herc.obj, hmode.obj)
  546.  
  547.     Subroutine: HText
  548.     object files: hmode.obj (q$herc.obj)
  549.  
  550.     Requires Hercules (mono or InColor)
  551.  
  552.         These subroutines change modes on the Hercules graphics card,
  553.     without using QBHERC.COM.  If you use HGraph to set graphics mode,
  554.     QuickBASIC video input/output functions will not work, and you must use
  555.     HText to restore text mode.  QB2/QB3/QB87 users MUST use HGraph to use
  556.     Hercules graphics.  HText resets the active page to 0.  (See UseTPage in
  557.     VIDEO.DOC).  HGraph clears the entire video buffer; HGraph0 clears only
  558.     page 0.
  559.  
  560.     With HGraph0, anything in graph page 1 is undisturbed.  A graph may
  561.     be stored in page 1, the system can be switched back to text mode for a
  562.     while, and if text page 8 - 15 are not used, the graph may be restored
  563.     by calling HGraph0 and GCopy(1, 0, oops%).
  564.  
  565.     HGraph0 can also be used if text screens are stored in pages 8 - 15.
  566.     As long as graph page 1 is not used, the text screens will not be
  567.     disturbed and can be restored with HText and TCopy.
  568.  
  569.     If you are using Hercules graphics in a 2-monitor system, use HGraph0.
  570.     HGraph0 and HText will make the Monochrome monitor the default; to
  571.     use the color monitor, call ModeColor (See VIDEO.DOC).
  572.  
  573.     Example:
  574.          CALL HGraph         ' establishes Hercules Graphics mode
  575.                              ' QLIB graphics subroutines will work properly
  576.          CALL HText          ' returns Hercules system to text mode
  577.  
  578.  
  579.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  580.  
  581.     Subroutine: GCenter(st$, y%, style%)
  582.     object files: gcenter.obj ($graph.obj, gprint.obj, $gp.obj, f8x14.obj)
  583.  
  584.     GCenter prints text on a graphics screen, centered horizontally.
  585.     This subroutine calculates the correct x-coordinate, then calls
  586.     GPrint.  GCenter supports all style% parameters and graphics
  587.     modes supported by GPrint.
  588.  
  589.     Example:
  590.         REM  I want to center a graph title at the top of the screen
  591.         y% = 0                   ' top of screen
  592.         style% = 1: title$ = "Graph Title"
  593.         CALL GCenter(title$, y%, style%)
  594.  
  595.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  596.  
  597.     Subroutine: GCenterX(st$, y%, style%)
  598.     object files: gcenterx.obj ($graph.obj, gprintx.obj, $gp.obj, f8x14.obj)
  599.  
  600.     GCenterX prints double-width text on a graphics screen, centered
  601.     horizontally.  This subroutine calculates the correct x-coordinate,
  602.     then calls GPrintX.  GCenterX supports all style% parameters and
  603.     graphics modes supported by GPrintX.
  604.  
  605.     Example:
  606.         REM  I want to center a graph title at the top of the screen
  607.         y% = 0                   ' top of screen
  608.         style% = 1
  609.         title$ = "Graph Title"
  610.         CALL GCenterX(title$, y%, style%)
  611.  
  612.  
  613.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  614.  
  615.     Subroutine: GLineEdit(st$, x%, y%, style%, options%, keycode%)
  616.     object files: gedit.obj (gcursor.obj, gprint.obj, lineedit.obj)
  617.  
  618.     Modes supported: All
  619.  
  620.       GLineEdit works like LineEdit (see INPUT.DOC), but is usable in
  621.     graphics modes.  GLineEdit uses all LineEdit options except 8 (BIOS
  622.     display) and -32768 (alternate cursor).  All LineEdit editing commands,
  623.     as well as StartEdit and LastEdit, work properly with GLineEdit.
  624.     GLineEdit also works fine with SmallText.  See LineEdit for examples.
  625.     Style% 1 and -1 work best.
  626.  
  627.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  628.  
  629.     Subroutine: GLoad(filename$, oops%)
  630.     Subroutine: GSave(filename$, oops%)
  631.     object files: gsave.obj ($graph.obj)
  632.  
  633.     Modes supported: HGraph (mono and InColor)
  634.                      VESA6A, XMode16, Super13, Super13a
  635.                      SCREEN 1,2,3,7,8,12,13
  636.                      SCREEN 9,10 (requires 128k+ EGA memory)
  637.  
  638.        GLoad loads a Graphics screen from a file to the screen.  The file
  639.     must have been previously saved by GSave.  GLoad and GSave load to or
  640.     save from the active graphics page.  Filename$ must be a ASCIIZ
  641.     (zero-terminated) string.  See example.  If no error occurred, oops% = 0.
  642.     Oops% will be an MS-DOS error code if a file handling error occurs.
  643.     See the introductory remarks in DISK.DOC for MS-DOS error codes.
  644.  
  645.     NOTE: files created by GSave eat lots of disk space:
  646.  
  647.          HGraph  (mono)      32,768 bytes
  648.          HGraph  (InColor)  131,072 bytes
  649.          Super13            128,000 bytes
  650.          Super13a           172,800 bytes
  651.          VESA6A             240,000 bytes
  652.          XMode16      up to 240,000 bytes
  653.          SCREEN 1            16,384 bytes
  654.          SCREEN 2            16,384 bytes
  655.          SCREEN 7            32,000 bytes
  656.          SCREEN 8            64,000 bytes
  657.          SCREEN 9           112,000 bytes
  658.          SCREEN 10           56,000 bytes
  659.          SCREEN 11           38,400 bytes
  660.          SCREEN 12          153,600 bytes
  661.          SCREEN 13           64,000 bytes
  662.  
  663.     Example:
  664.         filename$ = "BARGRAPH.HGC" + CHR$(0)
  665.         CALL GSave(filename$, oops%)
  666.  
  667.  
  668.  
  669.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  670.  
  671.     Subroutine: GPage(page%, oops%)
  672.     object files: gpage.obj ($graph.obj, q$herc.obj)
  673.  
  674.     Modes supported: HGraph (mono and InColor)
  675.                      Super13
  676.                      SCREEN 7,8
  677.                      SCREEN 9,10    (256k EGA memory)
  678.  
  679.         GPage combines the function of UseGPage and ShowGPage; see UseGPage
  680.     and ShowGPage for further information.
  681.  
  682.     Example:
  683.         CALL GPage(page%, oops%)
  684.         REM this is equivalent to
  685.         REM  CALL UseGPage(page%, oops%)
  686.         REM  CALL ShowGPage(page%, oops%)
  687.  
  688.  
  689.  
  690.  
  691.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  692.  
  693.     Subroutine: GPrint(st$, x%, y%, style%)
  694.     object files: gprint.obj ($graph.obj, $gp.obj, f8x14.obj)
  695.  
  696.     Modes supported: HGraph (mono amd InColor)
  697.                      VESA6A, XMode16, SVGA16
  698.                      Super13, Super13a SVGA256 (no style% 0)
  699.                      SCREEN 1  (style% 1 and -1 only)
  700.                      SCREEN 2,3,7,8,9,10,11,12,13
  701.  
  702.     GPrint offers much more flexibility than BASIC's PRINT command when
  703.     printing text on a graphics screen, and it's the only way to put text
  704.     on a Hercules graphics screen if MSHERC is not loaded.  GPrint prints
  705.     a string of text anywhere on the screen in normal, reverse video, XOR
  706.     or "foreground only" modes.  GPrint is also much faster than QB's PRINT
  707.     command in graphics modes.
  708.  
  709.     The size of each character and the number of characters across the
  710.     screen depends on the graphics mode:
  711.  
  712.     mode              standard character size    columns
  713.  
  714.     HGraph & SCREEN 3     8 x 14                    90
  715.     SCREEN 1, 7, 13       8 x 8                     40
  716.     SCREEN 2, 8           8 x 8                     80
  717.     SCREEN 9,10,11,12     8 x 14                    80
  718.     Super13               8 x 14                    40
  719.     Super13a              8 x 14                    45
  720.     VESA6A, SVGA16(0)     8 x 14                   100
  721.     XMode16               8 x 14                  varies
  722.     SVGA16(1), SVGA256(3) 8 x 14                   128
  723.     SVGA256(0 or 1)       8 x 14                    80
  724.     SVGA256(2)            8 x 14                   100
  725.  
  726.     All ASCII characters may be used.  x% and y% are the PIXEL locations of
  727.     the upper left corner of the first character.  SmallText, below, allows
  728.     GPrint to use the smaller 8 x 8 character in Hercules, VESA6A, XMode16,
  729.     SCREEN 9-12 and SVGA modes.  Legal style% values are -2, -1, 0, 1 and 2.
  730.  
  731.     In modes with 8 x 8 characters, you must call SmallText sometime
  732.     before calling GPrint if you use characters greater than CHR$(127).
  733.  
  734.     To calculate how many rows of text a graphics screen can display,
  735.     divide maximum Y by pixel rows (i.e., a Hercules screen can display
  736.     347/8 = 43 rows of text in SmallText mode).
  737.  
  738.     Example:
  739.       st$ = "This is an example of text in graphics mode"
  740.       x% = 10: y% = 20: CALL GPrint(st$, x%, y%, style%)
  741.  
  742.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  743.  
  744.     Subroutine: GPrintDOWN(st$, x%, y%, style%)
  745.     Subroutine: GPrintUP(st$, x%, y%, style%)
  746.     object files: gprint.obj (q$graph.obj, $gp.obj, f8x14.obj)
  747.  
  748.     Modes supported: same as GPrint
  749.  
  750.     GPrintUP rotates the string so that text reads from the bottom of
  751.     the screen to the top.  This is useful for labeling the vertical axis of
  752.     a graph, among other things.  GPrintDOWN reads from the top of the
  753.     screen to the bottom.  These subroutines use SmallText's 8 x 8 character
  754.     box, allowing up to 43 characters from the bottom of the screen to the
  755.     top in Hercules mode.  If you are going to use characters greater than
  756.     CHR$(127), you must call SmallText some time in your program before
  757.     calling GPrintDOWN/UP.  However, QLIB does not need to be in SmallText
  758.     mode when you call GPrintDOWN or GPrintUP.    All GPrint style% values are
  759.     valid.
  760.  
  761.     Example:
  762.          DEFINT a - z
  763.          CALL HGraph
  764.          CALL SmallText             ' let GPrintUP know where to find
  765.              .                      ' character definitions > CHR$(127)
  766.              .
  767.              .
  768.          CALL GPrintUP(text$, x%, y%, style%)
  769.  
  770.  
  771.  
  772.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  773.  
  774.     Subroutine: GPrintX(st$, x%, y%, style%)
  775.     Subroutine: GPrint2X(st$, x%, y%, style%)
  776.     Subroutine: GPrintDOWNX(st$, x%, y%, style%)
  777.     Subroutine: GPrintDOWN2X(st$, x%, y%, style%)
  778.     Subroutine: GPrintUPX(st$, x%, y%, style%)
  779.     Subroutine: GPrintUP2X(st$, x%, y%, style%)
  780.     object files: gprintx.obj (q$graph.obj, $gp.obj, f8x8.obj)
  781.  
  782.     Modes supported: same as GPrint
  783.  
  784.        GPrintX subroutines are similar to GPrint, GPrintUP and GPrintDOWN,
  785.     except each character in st$ is expanded to twice its normal horizontal
  786.     size before printing it on the screen; this is handy for graph headings.
  787.     GPrint2X subroutines expand each character horizontally and vertically;
  788.     All graphics modes and styles supported by GPrint work fine with these
  789.     expanded character subroutines.  See GPrint for example.
  790.  
  791.  
  792.  
  793.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  794.  
  795.     Subroutine: LinePattern(pattern$)
  796.     object files: fpattern.obj (drawline.obj)
  797.  
  798.        LinePattern passes a string of characters of up to 8 bytes to QLIB's
  799.     DrawLine and DrawBox subroutines.  The pattern of bits in pattern$ modify
  800.     lines so that they are drawn as a series of dots and/or dashes instead of
  801.     as a solid line.  Lines drawn with a pattern will be slower than those
  802.     drawn without a pattern.  In order to use pattern$, style% must be greater
  803.     than zero. On monochrome screens, only style% 1 and 2 are useful.
  804.     LinePattern must be called before each call to DrawLine or DrawBox if
  805.     it is to work.
  806.  
  807.     Modes supported: All
  808.  
  809.      Style% parameters have the following effects:
  810.  
  811.           style% 1 = both foreground and background colors are
  812.                   drawn, obliterating underlying pixels
  813.           style% 2 = foreground only replaces pre-existing pixels.
  814.           style% 3 = foreground is ORed with pre-existing pixels
  815.           style% 4 = foreground is ANDed with pre-existing pixels.
  816.  
  817.     Example:
  818.      pattern$ = SPACE$(8)
  819.      CALL LinePattern(pattern$)
  820.      CALL DrawBox(x0, y0, x1, y1, style%)
  821.  
  822.  
  823.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  824.  
  825.     Function: MakeGVScreen
  826.     Subroutine: KillGVScreen
  827.     object files: gvscreen.obj ($graph.obj, q$alloc.obj)
  828.  
  829.          MakeGVScreen permits Hercules graphics subroutines to be directed
  830.     to virtual screens.  This is similar to QLIB's text-mode VScreens.
  831.     Hercules virtual screens may be used with ANY computer, whether a
  832.     Hercules Graphics Card is installed or not.  After the graph has been
  833.     created in memory it can be printed with ScreenDump or saved with GSave.
  834.  
  835.     Graphics subroutines known to work with virtual screens include:
  836.  
  837.      Gprint        GPrintUP     GPrintDOWN     SmallText   StdText
  838.      DrawLine      DrawCircle   DrawBox        FillBox     FillArea
  839.      CircleAspect  FillPattern  GetPixel       SetPixel    GSave
  840.      GLoad         ScreenDump   GetGBlock      SetGBlock
  841.  
  842.     Example:
  843.         REM $INCLUDE: 'qlib.bi'
  844.         gseg% = MakeGVScreen       ' MakeGVScreen allocates memory for
  845.                                    ' the graph and makes QLIB's graphics
  846.                                    ' subroutines use that memory.  gseg% = 0
  847.                                    ' if insufficient memory is available.
  848.         CALL UseHercules           ' this is nessesary only if the computer
  849.                                    ' is in some other graphics mode
  850.  
  851.         CALL DrawLine(x0%, y0%, x1%, y1%, style%)
  852.              .
  853.              .
  854.              .
  855.         CALL KillGVScreen          ' release the memory and restore QLIB's
  856.                                    ' defaults after all I'm done with the
  857.                                    ' graph.
  858.         CALL UseDefault            ' do this if you called UseHercules
  859.  
  860.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  861.  
  862.     Subroutine: ScreenMode(mode%)
  863.     object files: scrmode.obj (hgraph.obj, hmode.obj)
  864.  
  865.     ScreenMode allows graphics or text mode to be set, bypassing
  866.     QuickBASIC's SCREEN command.  If your program uses QLIB's graphics
  867.     subroutines instead of QuickBASIC's graphics commands, you can reduce
  868.     your program's size significantly by using ScreenMode instead of
  869.     SCREEN.  ScreenMode also allows you to use VESA mode &H6A, which
  870.     is supported by QLIB's graphics (or use SVGA16 for high-resolution
  871.     16-color modes).
  872.  
  873.     The mode% parameter is the BIOS mode number for the screen mode
  874.     (except Hercules - QLIB uses the Microsoft convention of mode 8
  875.     for Hercules since no BIOS mode number exists for Hercules).
  876.  
  877.     BIOS mode numbers and the equivalent QuickBASIC SCREEN numbers are:
  878.  
  879.          BIOS number      equipment             SCREEN number
  880.  
  881.            &H3            CGA, MCGA, EGA, VGA   SCREEN 0 (text mode)
  882.            &H4            CGA, MCGA, EGA, VGA   SCREEN 1
  883.            &H5            CGA, MCGA, EGA, VGA   SCREEN 1
  884.            &H6            CGA, MCGA, EGA, VGA   SCREEN 2
  885.            &H7            Monochrome, Hercules  SCREEN 0 (text mode)
  886.                           EGA Monochrome
  887.            &H8            Hercules, InColor     SCREEN 3
  888.                                                 (requires MSHERC.COM)
  889.            &H40           ATT 6300              SCREEN 4
  890.            &HD            EGA, VGA              SCREEN 7
  891.            &HE            EGA, VGA              SCREEN 8
  892.            &HF            EGA, VGA (monochrome) SCREEN 10   128k+ memory
  893.            &H10           EGA, VGA              SCREEN 9    128k+ memory
  894.            &H11           MCGA, VGA             SCREEN 11
  895.            &H12           VGA                   SCREEN 12
  896.            &H13           MCGA, VGA             SCREEN 13
  897.            &H6A           VESA VGA
  898.  
  899.     NOTE: ScreenMode is NOT intended for switching between a color
  900.     monitor and a monochrome monitor.  Use ModeColor and ModeMono for
  901.     monitor switching.   
  902.  
  903.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  904.  
  905.     Subroutine: PutDot(x%, y%, style%)
  906.       (formerly SetPixel)
  907.     object files: putdot.obj ($graph.obj, $putdot.obj, $herc16,obj,
  908.                               $ega16.obj, $vga256.obj)
  909.  
  910.     Modes supported: All
  911.  
  912.          Sets the pixel at (x%, y%) according to the specified style% and
  913.     current GraphColor.  In monochrome modes, legal style% values are
  914.     -1, 0, and 1.  Color modes may use style% -4 through 4.  Coordinates
  915.     outside the active graphics viewport are ignored.
  916.  
  917.     Example:
  918.          x% = 10: y% = 10: style% = 0
  919.          CALL PutDot(x%, y%, style%)
  920.          REM  In this example, the pixel will be turned off if it had been
  921.          REM  on, and will be turned on if it had been off.
  922.  
  923.  
  924.  
  925.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  926.  
  927.     Subroutine: ScreenDump(oops%)
  928.     object files: scrndump.obj (q$graph.obj)
  929.  
  930.     Modes supported: HGraph (mono) not yet tested with InColor
  931.                      SCREEN 3
  932.  
  933.          Prints the active graphics screen on a graphics printer (Epson MX,
  934.     FX, RX; IBM Graphics Printer, IBM ProPrinter, and compatibles).
  935.     ScreenDump can be stopped with the ESC key.  If this occurs, oops% = 27
  936.     is returned (27 is the ASCII character code for the ESC key).  If the
  937.     computer is not in Hercules graphics mode, oops% = -1.  If all went
  938.     well, oops% = 0.  Use PrinterReady (EQUIP.DOC) to see if the printer is
  939.     ready.
  940.  
  941.     Example:
  942.          CALL ScreenDump(oops%)
  943.          oops$ = ""
  944.          IF oops% = -1 THEN oops$ = "Not Hercules mode"
  945.          IF oops% = 27 THEN oops$ = "Printing stopped"
  946.          IF LEN(oops$) THEN PRINT oops$
  947.  
  948.  
  949.  
  950.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  951.  
  952.     Subroutine: ShowGPage(gpage%, oops%)
  953.     object files: gpage.obj ($graph.obj)
  954.  
  955.     Modes supported: HGraph (mono and InColor) pages 0 and 1
  956.                             (must be default mode)
  957.                      SCREEN 3      pages 0 and 1
  958.                      SCREEN 7      pages 0 through 7  (depends on EGA memory)
  959.                      SCREEN 8      pages 0 through 3  (depends on EGA memory)
  960.                      SCREEN 9      pages 0 and 1      (256k EGA memory)
  961.                      SCREEN 10     pages 0 and 1      (256k EGA memory)
  962.                      Super13       pages 0 and 1
  963.  
  964.          ShowGPage changes the graph page visible on the screen.
  965.     This can be handy for animation or for storing one graph while another
  966.     is displayed.  If gpage% is too large for the default mode, oops% = -1.
  967.     See also GPage.
  968.  
  969.     Example:
  970.          CALL HGraph              ' establish Hercules graphics mode
  971.               .                   ' HGraph calls Use64k
  972.               .
  973.               .                   ' display graph 0
  974.               .
  975.          gpage% = 1
  976.          CALL UseGPage(gpage%, oops%)
  977.                                   ' now put a graph in the second page
  978.               .
  979.               .
  980.               .
  981.          CALL ShowGPage(gpage%, oops%)
  982.                                   ' let's look at graph 1 now that it's 
  983.               .                   ' complete
  984.               .
  985.               .
  986.          gpage% = 0
  987.          CALL GPage(gpage%, oops%) ' restore default output page
  988.                                    ' and look at graph 0
  989.  
  990.  
  991.  
  992.  
  993.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  994.  
  995.     Subroutine: ShowGraphPlane(plane%, oops)
  996.     object files: gplane.obj ($graph.obj)
  997.  
  998.     Modes supported: VESA6A, XMode16, SVGA16
  999.                      SCREEN 7,8,12
  1000.                      SCREEN 9  (128k or more EGA memory)
  1001.                      SCREEN 10 (planes 0 and 2, 128k or more EGA memory)
  1002.  
  1003.         EGA and VGA memory in 16-color modes is arranged in 4 parallel
  1004.     "planes".  The 16 colors available when all planes are visible result
  1005.     from a combination of the data bits in each plane at each data address.
  1006.     The planes, numbered 0, 1, 2 and 3, each control a single color.  With
  1007.     the default palette, plane 0 is blue, plane 1 is green, plane 2 is red
  1008.     and plane 3 is "intensity".  A pixel that appears bright blue in the
  1009.     screen represents pixels at identical locations in the Blue and Intensity
  1010.     planes.  (Note that the actual colors each plane represents may change
  1011.     depending on the use of QuickBASIC's COLOR and PALETTE statements).
  1012.  
  1013.     The plane% parameters are:
  1014.  
  1015.     plane 0    plane% = 1
  1016.     plane 1    plane% = 2
  1017.     plane 2    plane% = 4
  1018.     plane 3    plane% = 8
  1019.  
  1020.     Use BASIC's OR operator to show more than one plane; i.e., to
  1021.     show only planes 0 and 3, plane% = 1 OR 8.  To restore normal output,
  1022.     plane% = 1 OR 2 OR 4 OR 8.
  1023.  
  1024.     Example:
  1025.         CALL ShowGraphPlane(plane%, oops)
  1026.  
  1027.  
  1028.  
  1029.  
  1030.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  1031.  
  1032.     Subroutine: SetView(x0%, y0%, x1%, y1%)
  1033.     Subroutine: GetView(x0%, y0%, x1%, y1%)
  1034.     object files: view.obj ($graph.obj)
  1035.  
  1036.     Modes supported: All
  1037.  
  1038.          SetView establishes the active viewport on the active graphics
  1039.     page.  Most QLIB graphics subroutines limit their output to the
  1040.     active viewport.  GetView returns the viewport coordinates
  1041.     presently active.  QLIB's default viewport is the entire graphics
  1042.     screen.  If SetView is called with coordinates outside legal bounds
  1043.     (for example, if x1% = 1000), SetView limits the coordinates to the
  1044.     bounds for the active graphics mode (or to Hercules bounds if the
  1045.     system is either not in graphics mode or in an unsupported mode).
  1046.     This is NOT like QuickBASIC, which calls the out-of-bounds coordinate
  1047.     an illegal function call.  This SetView feature is handy for clearing
  1048.     out old view data or for establishing the entire screen as the
  1049.     viewport when the exact limits are variable or unknown (such as
  1050.     with XMode16).
  1051.  
  1052.     Example:
  1053.          CALL SetView(x0%, y0%, x1%, y1%)
  1054.  
  1055.  
  1056.  
  1057.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  1058.  
  1059.     Subroutine: SmallText
  1060.     Subroutine: StdText
  1061.     object files: smalltxt.obj (gprint.obj, q$graph.obj, f8x8.obj)
  1062.  
  1063.     Modes supported: HGraph (mono and InColor)
  1064.                      VESA6A, XMode16, SVGA16, SVGA256
  1065.                      SCREEN 3,9,10,12
  1066.  
  1067.     GPrint and GLineEdit may be set to use a smaller 8 x 8 character,
  1068.     which allows up to 43 rows of text in Hercules graphics mode, where
  1069.     StdText (QLIB's default) results in a maximum 25 rows of text.  Once
  1070.     SmallText is called, GPrint and GLineEdit will print 8 x 8 text until
  1071.     the 8 x 14 character is restored with StdText.  8x8 and 8x14 text
  1072.     may be mixed on one screen.
  1073.  
  1074.     Example:
  1075.          CALL HGraph               ' establish Hercules graphics mode
  1076.          CALL SmallText            ' sets GPrint to use small text
  1077.          CALL GPrint(a$, x0%, y0%, style%)
  1078.  
  1079.  
  1080.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  1081.  
  1082.     Subroutine: Super13
  1083.     object files: super13.obj ($graph.obj)
  1084.  
  1085.     Requires VGA
  1086.  
  1087.          This subroutine changes VGA cards to an undocumented 320 x 400
  1088.     256-color mode.  I have used this mode on PS/2 computers and with a
  1089.     variety of other VGA cards; it should be compatible with most VGA
  1090.     systems.  This mode has twice the resolution of SCREEN 13, and QLIB
  1091.     supports 2 pages in this mode.
  1092.  
  1093.     Example:
  1094.        CALL GetCRT(crt)
  1095.        IF crt = 3 THEN
  1096.            CALL Super13
  1097.            ELSE
  1098.            PRINT "Mode Super13 not available"
  1099.        END IF
  1100.           .
  1101.           .
  1102.           .
  1103.        REM  all done with graphics, go back to text mode
  1104.        CALL ModeColor               ' 80 x 25 text mode
  1105.        CALL XModeClear              ' clear QLIB's internal flags
  1106.  
  1107.  
  1108.  
  1109.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  1110.  
  1111.     Subroutine: Super13a
  1112.     object file: super13a.obj ($graph.obj)
  1113.  
  1114.     Requires VGA
  1115.  
  1116.          As with Super13 above, Super13a is an undocumented 256-color
  1117.     mode which I have used on PS/2 computers and with Paradise and Oak
  1118.     Technology VGA cards.  Super13a provides 360 x 480 resolution, 270% more
  1119.     pixels than the standard SCREEN 13.  This mode does not allow multiple
  1120.     pages.  See Super13 for example.  Super13a is based on John Bridges'
  1121.     public domain mode set code and parameters.
  1122.  
  1123.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  1124.  
  1125.     Function: goodmode% = SVGA16(i%)
  1126.     object file: svga16.obj (banks.obj)
  1127.  
  1128.     SVGA16 sets most super VGA boards in either a 1024x768 16-color mode
  1129.     (i% = 1) or an 800x600 16-color mode (i% = 0).  Boards supported are:
  1130.  
  1131.     Ahead Technologies
  1132.     ATI
  1133.     Chips & Technologies
  1134.     Everex
  1135.     Genoa GVGA
  1136.     NCR
  1137.     Oak Technologies
  1138.     Paradise (Western Digital)
  1139.     Trident
  1140.     Trident 8900
  1141.     Tseng (Genoa, Orchid, Willow)
  1142.     Tseng 4000
  1143.     VESA standard  (800x600 only)
  1144.     Video 7
  1145.  
  1146.     !! DO NOT USE ANY I% VALUES OTHER THAN 0 & 1 !!
  1147.  
  1148.     SVGA16() returns goodmode = 0 if the requested mode is not available
  1149.     on your equipment, goodmode <> 0 if successful.
  1150.  
  1151.     Most QLIB subroutines may be used with SVGA16 modes.  See documentation
  1152.     for each subroutine.
  1153.  
  1154.     QLIB's SVGA subroutines are derived from John Bridges' public domain
  1155.     VGAKIT board identification and bank switching code.
  1156.  
  1157.  
  1158.  
  1159.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  1160.  
  1161.     Function: goodmode% = SVGA256(i%)
  1162.     object file: svga256.obj (banks.obj)    
  1163.  
  1164.     SVGA256 is similar to SVGA16, but sets one of several 256-color modes.
  1165.     Modes available are:
  1166.  
  1167.     i% = 3:   1024x768
  1168.     i% = 2:    800x600
  1169.     i% = 1:    640x480
  1170.     i% = 0:    640x400
  1171.  
  1172.     Equipment supported is listed under SVGA16, plus:
  1173.  
  1174.     Compaq (640x480 only)
  1175.  
  1176.     !! DO NOT USE ANY I% VALUES OTHER THAN 0, 1, 2 & 3 !!
  1177.  
  1178.     SVGA256() returns goodmode = 0 if the requested mode is not available
  1179.     on your equipment, goodmode <> 0 if successful.
  1180.  
  1181.     Most QLIB subroutines may be used with SVGA16 modes.  See documentation
  1182.     for each subroutine.
  1183.  
  1184.     QLIB's SVGA subroutines are derived from John Bridges' public domain
  1185.     VGAKIT board identification and bank switching code.
  1186.  
  1187.  
  1188.  
  1189.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  1190.  
  1191.     Subroutine: Use32k
  1192.     Subroutine: Use64k
  1193.     object file: q$herc.obj
  1194.  
  1195.     Requires Hercules (mono or InColor)
  1196.  
  1197.          Use32k masks the second 32k block of Hercules memory out of the
  1198.     memory map.  If the second 32k is included in the memory map, QLIB's
  1199.     video routines can use all Hercules screen pages.  The second 32k of
  1200.     Hercules video memory conflicts with most color monitors' address space,
  1201.     so Use32k should be used to mask the second 32k out of the memory map
  1202.     for two-monitor systems.  Use64k allows the second block.  QLIB's
  1203.     default is Use32k.   You MUST call Use64k if you want to use graphics
  1204.     page 1 with Hercules systems.
  1205.  
  1206.     Example:
  1207.          CALL GetCRT(crt%)
  1208.          IF crt% >= 128 THEN CALL Use64k
  1209.  
  1210.  
  1211.  
  1212.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  1213.  
  1214.     Subroutine: UseFont (fseg%, fptr%, points%, bytes%)
  1215.     object files: usefont.obj, f8x14.obj
  1216.  
  1217.     Supports: all graphics modes with ymax% > 200
  1218.  
  1219.     UseFont permits use of non-standard fonts with GPrint, GPrintX, GCenter
  1220.     and GCenterX.  The font you wish to use must be somewhere in memory,
  1221.     either "hardwired" into your program or loaded from a disk file.
  1222.  
  1223.     Parameters used when calling UseFont are:
  1224.  
  1225.     fseg% = segment address of character definition data
  1226.     fptr% = offset address of character definition data
  1227.     points% = height of each character on screen (in pixel rows)
  1228.     bytes% = byte interval from the start of one character definition
  1229.              to the next
  1230.  
  1231.     QLIB's GPrint subroutines assume that each character is 8 pixels wide.
  1232.  
  1233.     Example:
  1234.       REM $INCLUDE: 'C:\QB4\QLIB.BI'
  1235.       REM   I want to use the italic font supplied by Hercules with the
  1236.       REM   InColor Card and Graphics Card Plus.  All Hercules font files
  1237.       REM   have a byte interval of 16, even for those fonts which are
  1238.       REM   less than 16 points high.
  1239.  
  1240.       filename$ = "C:\RAMFONT\ITALICS.FNT" + CHR$(0)
  1241.       fseg% = FLoad (filename$)       ' load font file into far memory
  1242.       fptr% = 0                       ' Hercules font definitions begin
  1243.                                       ' at the start of the file
  1244.       points% = 14: bytes% = 16       ' 14-point font
  1245.  
  1246.       CALL UseFont (fseg%, fptr%, points%, bytes%)
  1247.                                       ' GPrint will now use italics font
  1248.                                       ' until SmallText or StdText is
  1249.                                       ' is called, or until UseFont is
  1250.                                       ' called with another font definition
  1251.  
  1252.   
  1253.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  1254.  
  1255.     Subroutine: UseHercules
  1256.     Subroutine: UseDefault
  1257.     object file: q$graph.obj
  1258.  
  1259.       UseHercules forces QLIB's graphics subroutines to use Hercules-
  1260.     mode algorithms.  This is handy when you want to create a virtual
  1261.     graphics screen (for ScreenDump, as an example) while the computer
  1262.     is displaying a graph in another graphics mode.  UseDefault causes
  1263.     QLIB to use the algorithms for the system's active graphics mode.
  1264.     UseHercules is NOT required if the system is in Hercules mode.
  1265.  
  1266.     Example:
  1267.       CALL UseHercules
  1268.           .
  1269.           .
  1270.           .
  1271.       CALL UseDefault
  1272.  
  1273.  
  1274.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  1275.  
  1276.     Subroutine: UseGPage(gpage%, oops%)
  1277.     object files: gpage.obj ($graph.obj)
  1278.  
  1279.     Modes supported: HGraph (mono and InColor)    pages 0 and 1
  1280.                      SCREEN 3         pages 0 and 1
  1281.                      SCREEN 7         pages 0 through 7  (with 265k EGA)
  1282.                      SCREEN 8         pages 0 through 3  (with 265k EGA)
  1283.                      SCREEN 9         pages 0 and 1      (256k EGA memory)
  1284.                      SCREEN 10        pages 0 and 1      (256k EGA memory)
  1285.                      Super13          pages 0 and 1
  1286.  
  1287.          UseGPage changes the default screen page for QLIB's graphics
  1288.     subroutines.  QLIB's default gpage% is 0.  If multiple pages are not
  1289.     available for the current mode, or gpage% is too big, oops% = -1.
  1290.  
  1291.     Example:
  1292.          CALL HGraph              ' establish Hercules graphics mode
  1293.                                   ' HGraph calls Use64k
  1294.          gpage% = 1
  1295.          CALL UseGPage(gpage%, oops%)
  1296.                                   ' QLIB's graphics subroutines use page 1 now
  1297.  
  1298.  
  1299.  
  1300.  
  1301.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  1302.  
  1303.     Function: goodboard = WhichVGA
  1304.     object file: banks.obj
  1305.  
  1306.     WhichVGA identifies supported video boards and sets up the VGAKIT
  1307.     software for the equipment installed.  Goodboard = 0 if a supported
  1308.     board is not installed, or goodboard <> 0 if a VGAKIT-compatible
  1309.     SVGA is installed.
  1310.  
  1311.     You do not need to call WhichVGA before call SVGA16() or SVGA256().
  1312.  
  1313.     Example:
  1314.  
  1315.     DEFINT A-Z
  1316.     DECLARE FUNCTION whichvga ()
  1317.     DECLARE FUNCTION svga256 (i%)
  1318.         IF whichvga THEN
  1319.             svga = svga256(3)
  1320.             IF svga = 0 THEN END
  1321.             CALL bprint("SVGA", 17, 12, 12)
  1322.             CALL GraphColor(12)
  1323.             CALL line256(0, 0, 1000, 1000, 1)  ' line is clipped
  1324.                                                ' at creen edge
  1325.             .
  1326.             .
  1327.             .
  1328.         ' all done with SVGA
  1329.             call modecolor
  1330.             call xmodeclear
  1331.  
  1332.  
  1333.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  1334.  
  1335.     Subroutine: XMode16(m%, maxX%, maxY%)
  1336.     Subroutine: XMode16A(m0%, m1%, maxX%, maxY%)
  1337.     object file: xmode.obj ($graph.obj)
  1338.  
  1339.     Subroutine: XModeClear
  1340.     Subroutine: ModeColor
  1341.  
  1342.        XMode16 subroutines allow the use of many extended EGA and VGA
  1343.     graphics cards at higher resolutions than IBM's products allow, in
  1344.     16-color modes.  Depending on the graphics card/monitor combination
  1345.     in use, resolutions up to 800 pixels horizontal and 600 pixels vertical
  1346.     are possible.  The manual supplied with your extended EGA or VGA card
  1347.     contains the information you need to put the high-resolution modes to
  1348.     work.  A multi-frequency monitor is generally required (see the graphics
  1349.     card manual for specific requirements).
  1350.  
  1351.     You must have the required equipment and use the correct mode number;
  1352.     hardware damage may result from improper use of XMode16.  I cannot be
  1353.     held responsible for damage resulting from use of XMode16.
  1354.  
  1355.     When using XMode16, the parameters required are:
  1356.  
  1357.      m% = mode number (from graphics card manual, for 8086 register AL)
  1358.      maxX% = maximum horizontal dimension
  1359.      maxY% = maximum vertical dimension
  1360.  
  1361.     If 800 horizontal pixels are available, maxX% should be 799.  Similarly,
  1362.     if 600 vertical pixels are possible, maxY% should be 599.
  1363.  
  1364.     If your graphics card requires two mode parameters in the 8086's
  1365.     AL and BL registers, use XMode16A instead, where
  1366.  
  1367.      m0% = mode number for AL register
  1368.      m1% = mode number for BL register
  1369.      maxX% = maximum horizontal dimension
  1370.      maxY% = maximum vertical dimension
  1371.  
  1372.     Any QLIB subroutines compatible with XMode16 will work equally well
  1373.     with XMode16A.
  1374.  
  1375.     Your graphics card manual lists mode numbers, equipment requirements,
  1376.     and the number of horizontal and vertical pixels corresponding to the
  1377.     mode.  Mode numbers are usually in hex format.  Some modes and
  1378.     corresponding mode numbers are listed on the next page:
  1379.  
  1380.  
  1381.  
  1382.     Equipment            mode     mode number   Example
  1383.  
  1384.     Orchid ProDesigner   800x600     &H29       CALL XMode16(&H29, 799%, 599%)
  1385.     STB EM/16
  1386.     Genoa
  1387.     Sigma X16
  1388.  
  1389.  
  1390.     Everex MED EGA       640X480     &H70, &H00
  1391.     (Micro Enhancer Deluxe)                CALL XMode16a(&H70, &H00, 639%, 479%)
  1392.                          752x410     &H70, &H01
  1393.                                            CALL XMode16a(&H70, &H01, 751%, 409%)
  1394.  
  1395.  
  1396.     ATI VGA Wonder       800x600     &H54       CALL XMode16(&H54, 799%, 599%)
  1397.  
  1398.  
  1399.     ATI VIP              800x560     &H53       CALL XMode16(&H53, 799%, 559%)
  1400.  
  1401.  
  1402.     Paradise Plus-16     800x600     &H58       CALL XMode16(&H58, 799%, 599%)
  1403.     Paradise Professional
  1404.  
  1405.     Video 7 Fastwrite    800x600     &H62       CALL XMode16(&H62, 799%, 599%)
  1406.     Video 7 VRAM
  1407.  
  1408.     If any of this information conflicts with the specifications in your
  1409.     video card's instruction manual, the manual's recommendation is a safer
  1410.     bet.  Note that all the above modes require a multi-frequency monitor.
  1411.  
  1412.     When you're all done with Graphics mode, CALL ModeColor to return to
  1413.     80x25 text mode, and CALL XModeClear to reset QLIB's internal XMode flags.
  1414.  
  1415.  
  1416.      REM  All done with graphics for now, go back to 80 x 25 text mode
  1417.      CALL ModeColor
  1418.      REM  also clear QLIB's internal flags
  1419.      CALL XModeClear
  1420.  
  1421.   ***************** QWINDOW USER-DEFINED COORDINATE SUBSYSTEM ****************
  1422.  
  1423.  
  1424.   The QLIB QWindow user-defined coordinate subsystem for QLIB graphics is
  1425.   intended as a replacement for BASIC's WINDOW command.  The QWindow system
  1426.   permits the programmer to specify custom coordinates for any QLIB graphics
  1427.   mode, and changes the direction of increasing y-coordinates from the
  1428.   default top-to-bottom to the more familiar bottom-to-top orientation.
  1429.  
  1430.   QWindow subroutines are listed at the end of this file.
  1431.  
  1432.   For each QWindow graphics subroutine, the usage and calling parameters are
  1433.   identical to the primary QLIB graphics subroutine.  For example,
  1434.   to use QWBitBlockBytes, see the documentation for BitBlockBytes, but
  1435.   call QWBitBlockBytes with QWindow coordinates.
  1436.  
  1437.   If you have defined your own coordinates, you may still use QLIB's primary
  1438.   graphics subroutines with the absolute coordinates at the beginning of
  1439.   this file.  If your program repeatedly calls QLIB graphics subroutines
  1440.   with the same coordinates, your program will run a bit faster if you
  1441.   convert QWindow coordinates to QLIB's native absolute coordinates and
  1442.   use the non-QWindow subroutine.  See QW2Abs.
  1443.  
  1444.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  1445.  
  1446.     Subroutine: QW2Abs(x, y)
  1447.     object file: qw2abs.obj, qwindow.obj
  1448.  
  1449.         QW2Abs converts QWindow coordinates to QLIB's native absolute
  1450.     coordinates.  This is handy if you will be repeatedly calling QLIB
  1451.     graphics subroutines with the same coordinates; convertng to absolute
  1452.     coordinates and calling the non-QWindow subroutine will make your
  1453.     program run a bit faster.
  1454.  
  1455.  
  1456.    
  1457.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  1458.  
  1459.     Subroutine: QWindow(x0, y0, x1, y1)
  1460.     object file: qwindow.obj ($graph.obj)
  1461.  
  1462.         QWindow establishes the user-defined coordinate system.  The
  1463.     coordinate at (x0, y0) is the lower left corner of the working area
  1464.     and the coordinate at (x1, y1) is the upper right corner of the area.
  1465.     The working area can be either the entire screen or QLIB's active view
  1466.     area (see QWScreen and QWView).  If x0 is less than 0, the origin
  1467.     of the horizontal axis will be shifted right.  If y0 is less than 0,
  1468.     the origin of the vertical axis will be shifted up.
  1469.     
  1470.  
  1471.     Example:
  1472.        DEFINT A-Z
  1473.        REM  my data series has a minimum y-value of -32 and a maximum
  1474.        REM  y-value of 181, while the x-values range from -10 to 75
  1475.  
  1476.        CALL ScreenMode(&H10)                ' EGA 640x350 mode
  1477.        CALL QWScreen                        ' coordinates relative
  1478.                                             ' to entire screen
  1479.        CALL QWindow(-10, -32, 75, 181)      ' user-defined graph coordinates
  1480.        CALL QWLine(0, -32, 0, 181, 1)       ' draw vertical axis
  1481.        CALL QWLine(-10, 0, 75, 0,  1)       ' draw horizontal axis
  1482.  
  1483.        REM put dots on the screen for a X vs. Y chart
  1484.        FOR i = 0 to 100
  1485.            CALL QWPutDot(x%(i), y%(i), style%)
  1486.        NEXT i
  1487.  
  1488.  
  1489.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  1490.  
  1491.     Subroutine: QWScreen
  1492.     Subroutine: QWView
  1493.     object file: qwindow.obj ($graph.obj)
  1494.  
  1495.        These subroutines allow you to define your coordinate system
  1496.     relative to the entire screen (QWScreen) or relative to QLIB's active
  1497.     View area.
  1498.  
  1499.     Example:
  1500.        DEFINT A-Z
  1501.        REM  I want to use 90% of the screen dimensions for a plot with
  1502.        REM  coordinates from -100 to +100
  1503.  
  1504.        REM  start with View equal to entire screen area
  1505.        CALL ResetView
  1506.  
  1507.        REM  next, define the coordinate system, relative to entire screen
  1508.        CALL QWindow(-100, -100, 100, 100)
  1509.        CALL QWScreen
  1510.  
  1511.        REM  now get the absolute coordinates for 90% of the screen dimensions
  1512.        x0% = -90: y0% = -90
  1513.        x1% = 90: y0% = 90
  1514.        CALL QW2Abs(x0%, y0%)       ' convert first coordinate
  1515.        CALL QW2Abs(x1%, y1%)       ' convert second coordinate
  1516.  
  1517.        REM  use absolute coordinates to set QLIB view area
  1518.        CALL SetView(x0%, y0%, x1%, y1%)
  1519.  
  1520.        REM  make QWindow coordinates relative to active view area
  1521.        CALL QWView
  1522.  
  1523.        REM  ready to go!
  1524.  
  1525.  
  1526.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  1527.  
  1528.     QWindow subroutines, the comparable QLIB subroutine and QWindow
  1529.     object files are listed below:
  1530.  
  1531.     QWindow subroutine   QLIB subroutine      object file
  1532.  
  1533.     QWLine               DrawLine             qwline.obj
  1534.     QWBox                DrawBox              qwline.obj
  1535.     QWFillBox            FillBox              qwline.obj
  1536.     QWFill               FillArea             qwfill.obj
  1537.     QWGCenter            GCenter              qwcenter.obj
  1538.     QWGCenterX           GCenterX             qwcentrx.obj
  1539.     QWCircle             DrawCircle           qwcircle.obj
  1540.     QWGLineEdit          GLineEdit            qwgedit.obj
  1541.     QWGPrint             GPrint               qwgprint.obj
  1542.     QWGPrintUP           GPrintUP             qwgprint.obj
  1543.     QWGPrintDOWN         GPrintDOWN           qwgprint.obj
  1544.     QWBitBlockBytes      BitBlockBytes        qwblock.obj
  1545.     QWBitBlockSave       BitBlockSave         qwblock.obj
  1546.     QWBitBlockRestore    BitBlockRestore      qwblock.obj
  1547.     QWBitPlaneBytes      BitPlaneBytes        qwplane.obj
  1548.     QWBitPlaneSave       BitPlaneSave         qwplane.obj
  1549.     QWBitPlaneRestore    BitPlaneRestore      qwplane.obj
  1550.     QWGetDot             GetDot               qwgetdot.obj
  1551.     QWPutDot             PutDot               qwputdot.obj
  1552.     QWGPrintX            GPrintX              qwprintx.obj
  1553.     QWGPrint2X           GPrint2X             qwprintx.obj
  1554.     QWGPrintUPX          GPrintUPX            qwprintx.obj
  1555.     QWGPrintDOWNX        GPrintDOWNX          qwprintx.obj
  1556.     QWGPrintUP2X         GPrintUP2X           qwprintx.obj
  1557.     QWGPrintDOWN2X       GPrintDOWN2X         qwprintx.obj
  1558.     QWGCursor            GCursor              qwcursor.obj
  1559.     QWGUCursor           GUCursor             qwcursor.obj
  1560.  
  1561.     In all cases, QWindow subroutines are called from your BASIC program
  1562.     with the same parameters, except that screen coordinates are QWindow
  1563.     coordinates instead of QLIB's native absolute pixel locations.
  1564.  
  1565.